/**
 * Definition for a binary tree node.
 * function TreeNode(val) {
 *     this.val = val;
 *     this.left = this.right = null;
 * }
 */
/**
 * @param {TreeNode} root
 * @return {number[]}
 */

let res = [];
var inorderTraversal = function(root) {
    if(!root) return;

    iffunction(root.left);
    res.push(root.val);
    function(root.right);

    return res;
};